﻿using DreamCMS.BLL;
using DreamCMS.WebCore.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace DreamCMS.Web.Admin.ArtMgr
{
    public partial class Manage : AdminPageBase
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                rpArt.DataSource = PostManager.GetPostList();
                rpArt.DataBind();
            }
        }

        protected void lkbDelete_Command(object sender, CommandEventArgs e)
        {
            string id=e.CommandArgument.ToString();
            if (PostManager.DeletePostById(StringHelper.StrToInt64(id,0))>0)
            {
                rpArt.DataSource = PostManager.GetPostList();
                rpArt.DataBind();
            }
            else
            {
                ClientScript.RegisterStartupScript(GetType(), "failed", "<script>alert(\"删除失败\");</script>");
                
            }

        }
    }
}